<!DOCTYPE html>
<html>
<#include "../../common/header.ftl">
<script src="${basePath}/js/userGrade/list.js?v=201711021700"></script>

<head>
<meta charset="UTF-8">
<title>用户等级管理</title>
<style>
	.left{
		float:left;
		min-width:100px;
		margin-left: 10px;
	}
	.table-margin{
		margin:5px 3%;
		width:92%;
	}
</style>

</head>
<body>
   
<div class="container" style="margin-left:5%;width:90%">
	<form class="layui-form left" action="#" >
		<div class="layui-form-item ">
			<#if permission?? && (permission.P603??)>
		     <button type="button" class="layui-btn layui-btn-normal" id="add-button">新增等级</button>
			</#if>
		</div>
	</form>
</div>
<table class="table table-margin">
  <thead>
      <tr>
         <th style="width:20%;">等级名称</th>
         <th style="width:10%;">等级折扣</th>
         <th style="width:10%;">是否默认等级</th>
         <th style="width:10%;">创建人</th>
         <th style="width:15%;">创建时间</th>
         <th style="width:10%;">操作</th>
      </tr>
  </thead>
  <tbody>
	<#list gradeList! as grade>
		<tr>
			<td>${grade.name!}</td>
			<td>${grade.discount!}</td>
			<td><#if grade.isDefault?? &&grade.isDefault==1>是
				<#else>否
				</#if>
			</td>
			<td>${grade.creator!}</td>
			<td>${grade.createTime?string("yyyy-MM-dd HH:mm")}</td>
			<td>
				<div class="btn-group ">
				  <button type="button" class="btn btn-primary dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
				    	操作<span class="caret"></span>
				  </button>
				  <ul class="dropdown-menu">
					<#if permission?? && (permission.P604??)>
				    <li><a href="#" onclick="editFun('${grade.id}')">修改</a></li>
					</#if>				  
					<#if permission?? && (permission.P606??)>
				    <li><a href="#" onclick="deleteFun('${grade.id}')">删除</a></li>
					</#if>				  
				  </ul>
				</div>
			</td>
		</tr>
	</#list>
  </tbody>
</table>
</body>
<script type="text/javascript">
	var basePath="${basePath}";
	var init={
	}
	$(function(){
		layui.use(['form', 'layer'] , function(){
		  var layer = layui.layer;
		  var form = layui.form(); 
	});
});
</script>
</html>